import { getAllBrandListService } from '@/api/commodity/common';

// 商品大类
const PRODUCT_TYPE_OPTIONS = {
  0: '正常商品',
  1: '线索商品',
  2: '客户专属商品',
  3: 'YD项目商品',
  5: '临时项目商品',
  6: '潜在商品',
}
// 停启用状态
const ENABLE_STATUS_OPTIONS = {
  1: '启用',
  2: '停用',
}
export const FORM_ITEMS = [
  {
    prop: 'skuNo',
    label: '商品编码',
    type: 'input'
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input'
  },
  {
    prop: 'brandUuid',
    label: '品牌',
    type: 'select',
    remote: true,
    remoteMethod: getAllBrandListService,
    paramKey: 'brandName',
    optionKeys: { valueKey: 'brandUuid', labelKey: 'brandName' },
  },
]
// 列表表头
export const TABLE_COLUMNS = [
  {
    title: '商品编号',
    key: 'skuNo',
  },
  {
    title: '商品名称',
    key: 'productName',
  },
  {
    title: '规格',
    key: 'specDetail'
  },
  {
    title: '计量单位',
    key: 'unitName'
  },
  {
    title: '品类名称',
    key: 'categoryName'
  },
  {
    title: '品牌名称',
    key: 'brandName'
  },
  {
    title: '商品大类',
    key: 'enumTempProduct',
    formatter: (row, columns, cellValue) => {
      return PRODUCT_TYPE_OPTIONS[cellValue];
    }
  },
  {
    title: '停启用状态',
    key: 'enableStatus',
    formatter: (row, columns, cellValue) => {
      return ENABLE_STATUS_OPTIONS[cellValue];
    }
  },
  {
    title: '商品主码',
    key: 'mainSkuNo'
  }
]
